package cn.gson.crm.model.dao;


import java.util.List;

import org.springframework.data.domain.Pageable;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;


import cn.gson.crm.model.pojo.Product;





public interface ProductDao extends CrudRepository<Product,Long>{
	@Query("from 	Product order by productId")
	public List<Product>queryByPage(Pageable p);
	public List<Product>findByProductNameLike(String key,Pageable p);
	public List<Product>findByProInfoSta(String key);
	@Query("select count(*)from Product e where e.productName like ?1 order by productId")
	public long countwhere(String key);
	public Product findOneByProductId(Long key);

	
}
